// yaz: yet another zip app
#pragma once

#include <functional>
#include <memory>
#include <string_view>//better perfermance?

namespace yaz {
  // NOTE: GLOBAL
  using ByteSourceFn = std::function<std::string_view()>;
  using ByteSinkFn = std::function<bool(std::string_view out)>;
  // (string_view)->string_view()
  ByteSourceFn MemoryByteSource(std::string_view input);
  // (const char *) -> string_view()
  ByteSourceFn FileByteSource(const char *filename);
  // NOTE: End GLOBAL

  struct Encoder {
  // default public
  Encoder(int compression_level, ByteSinkFn out);

  ~Encoder();

  bool AddFile(std::string_view filename, const ByteSourceFn& content_generator);

  bool Finish();
    private:
    struct Impl;// NOTE: impl design pattern
    std::unique_ptr<Impl> impl_;
  }; // strutc Encoder

} // namespace yaz

